//valueOf 目标是将一个对象转成原始的值 primitive value

let myDate = new Date();
console.log(myDate.valueOf());//1685073736168
let myNumber = new Number(100);
console.log(myNumber.valueOf())//100
let myBoolean = new Boolean(true);
console.log(myBoolean.valueOf())//true
let obj = {
    valueOf(){
        return 1;
    }
};
console.log(obj.valueOf());//{}

console.log(obj+2);//3
